//Wed Jun 30 18:26:30 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class PalindromesCount
{
public:
	int count(string A, string B)
	{
		int sum = 0;
		for (int i = 0; i <= A.size(); i++)
		{
			string temp = A.substr(0, i) + B + A.substr(i);
			if (isPalindromes(temp))
				sum++;
		}
		return sum;
	}
	bool isPalindromes(string A)
	{
		string ret = A;
		reverse(ret.begin(), ret.end());
		if (A == ret)
			return true;
		return false;
	}
};
